package com.etc.controller;

import com.etc.entity.ShopCar;
import com.etc.service.IShopCapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author
 * @Description
 * @Date 2021/1/4  17:01
 **/
@RestController
@RequestMapping("/shopCar")
public class ShopCarController {
    @Autowired
    private IShopCapService iShopCapService;
    @GetMapping("/findAll")
    public List<ShopCar> getShopCar(){
       return iShopCapService.findAll();
    }
    @GetMapping("/add")
    public Integer addShopCar (ShopCar shopCar){
       return iShopCapService.add(shopCar);
    }
    @GetMapping("/delete")
    public Integer deleteShopCar(Integer id){
      return iShopCapService.deleteById(id);
    }
}
